package com.dawan.sbjy.util;

import com.auth0.jwt.JWT;
import com.auth0.jwt.algorithms.Algorithm;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import java.util.Map;

@Component
public class GetToken {
    @Value("${sbjy.jwtsecret}")
    public  String secret;

    public  String createToken(String userinf) {
        String token= JWT.create().withAudience(userinf)
                .sign(Algorithm.HMAC256(this.secret));
        return token;
    }
}
